package com.qf.controller;

import com.qf.entity.User;
import com.qf.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/basic")
public class MyController {


    @Autowired
    private UserMapper UserMapper;


    @RequestMapping("/test01")
    @ResponseBody
    public String test01(){
        return "springboot快速搭建完成";
    }

    /**
     * 查询用户列表数据
     * @return
     */
    @RequestMapping("/queryUserList")
    @ResponseBody
    public List<User> queryUserList(){
        List<User> users = UserMapper.queryUserList();
        return users;

    }
}